<template>
	<view>
		<view class="title">基准金额</view>
		<view class="title" style="color: #007AFF;">{{normalAmount}}</view>
		<view class="operaMsg">格式化：{{ amountThousandth}}</view>
		<view class="operaMsg">还原：{{ thousandthAmount}}</view>
		<view class="operaMsg">金额 1366.332相加：{{ addAmount}}</view>
		<view class="operaMsg">金额 1316.392相减：{{ subtractAmount}}</view>
		<view class="operaMsg">金额 1316.392相乘：{{ multiplyAmount}}</view>
		<view class="operaMsg">金额 1316.392相除：{{ dividedAmount}}</view>
		<view class="operaMsg">金额 四舍五入支持其他舍入规则：</br>{{roundAmount}}</view>
		
	</view>
</template>

<script>
	import amountUtils from "../../utils/amount/amountUtils.js"
	export default {
		data() {
			return {
				normalAmount: 1300023.133,
				amountThousandth: 0,
				thousandthAmount: 0,
				addAmount: 0,
				subtractAmount:0,
				multiplyAmount:0,
				dividedAmount:0,
				roundAmount:0,
			}
		},
		onLoad() { //数据还是要加this，才能表示是当前页面需要的
			var thousandthNum = amountUtils.amountFormatThousandth(this.normalAmount);
			this.amountThousandth = thousandthNum;
			this.thousandthAmount = amountUtils.thousandthFormatamount(thousandthNum);
			this.addAmount = amountUtils.amountAdd(this.normalAmount,1366.332);
			this.subtractAmount=amountUtils.amountSubtract(this.normalAmount,1316.392);
			this.multiplyAmount=amountUtils.amountMultiply(this.normalAmount,1316.392);
			this.dividedAmount=amountUtils.amountDivided(this.normalAmount,1316.392);
			this.roundAmount = amountUtils.amountRounding(this.normalAmount,2,".",",","ceil");
		},
		onReady() {},
		methods: {

		}
	}
</script>

<style scoped>
	.title {
		text-align: center;
	}
	.operaMsg{
		padding-left: 30rpx;
		font-size: 38rpx;
		color: #333333;
	}
</style>
